<template>
    <div class="shop">
      <img class="shop-img" :src="shop.imgUrl" :alt="shop.name" />
      <div class="shop-item">
        <div class="shop-item-title">{{ shop.name }}</div>
        <div class="shop-item-tags">
          <span class="shop-item-tag">月售：{{ shop.sales }} 件</span>
          <span class="shop-item-tag">起送：{{ shop.limit }} 元</span>
          <span class="shop-item-tag">基础送费：{{ shop.price }} 元</span>
        </div>
        <p class="shop-item-desc">{{ shop.desc }}</p>
      </div>
    </div>
</template>

<script setup>
// 接收shop父组件传过来的数组
defineProps(['shop'])
</script>

<style lang="scss" scoped>
.shop {
    display: flex;
    padding: 1.2rem 0;
    border-bottom: 0.1rem solid #f1f1f1;
    &:first-child {
      border-bottom: 0;
    }
    &-img {
      margin-right: 1.6rem;
      width: 8.6rem;
      height: 8.6rem;
    }
    &-item {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      @include ellipsis;
      &-title {
        line-height: 2rem;
        font-size: 1.6rem;
      }
      &-tags {
        margin-top: 0.8rem;
        line-height: 1.8rem;
        font-size: 1.3rem;
        padding-right: 0.5rem;
        @include ellipsis;
        .shop-item-tag {
          margin-right: 1.6rem;
        }
      }
      &-desc {
        margin: 0.8rem 0 0 0;
        line-height: 1.8rem;
        font-size: 1.3rem;
        color: #e93b3b;
      }
    }
}
</style>
